from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

# 1. 启动浏览器
driver = webdriver.Chrome()

# 2. 打开视频网站
driver.get('http://69.231.135.101/pgktjwsnew/#/videoPlay?curCourse=CSS%E5%9F%BA%E7%A1%80&type=1&id=ed755ee8f42f4c62873a73cc4bcde93c&key=d6F0EMViVeP9dUzcceYTsUhaqAQMndqvCsWHyeP%2Fj%2FcVDfuamQ%2B2p3KR4l%2FZ1YG59C3eLtER2ZPMfP%2BNsh2l4GDCW0Hci1L5V1WEJYpfWCJelU%2F1XBhNIPrVGylzcyFMfnUIdr8%2B9RRj4AaKHuiH0hgzI%2Fs%2F8eml1PayZ24ZO4FLoMCdUE82E6yuMGlqysqC0QPoUYYy9y9AmDxv57gM7w%3D%3D&playPosition=338.166667')

# 3. 等待页面加载
time.sleep(5)

# 4. 自动点击播放按钮
play_button = driver.find_element(By.CSS_SELECTOR, '.play-button')  # 根据实际页面修改
play_button.click()

# 5. 持续观看一段时间
time.sleep(600)  # 观看10分钟

# 6. 关闭浏览器
driver.quit()